<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <title>提交订单页面</title>
</head>
<body>
<?php
include_once("header.php");
check_loginuser();
?>
<?php
$info = db_get_row("select * from user where id=".$_SESSION["id"]);
 ?>
<div class="m_ctr">
    <div class="ej_tctr">当前位置：<a href="index.php">首页</a> &gt; 提交订单</div>
    <div class="m_ctr1">
        <form id="myform" name="form1" action="savedd.php" method="post" onsubmit="return check();">
			<?php 
			$cart_id = $_POST['cart_id']; 
			for($i=0;$i<count($cart_id);$i++){?>
			<input type="hidden" value="<?php echo $cart_id[$i];?>" name="cart_id[]" />
			<?php
			 }
			?> 
			<div class="" style="width: 400px; margin: auto">
                <?php 
				$rowadd = db_get_all("select * from address where userid=".$_SESSION["id"]." order by status desc");
				// var_dump($rowadd[0]);
				if(empty($rowadd[0])){
					urlMsg("请填写收货地址", "./user/index.php");
					die;
				}?>
				<?php 
				$i = 1;
				foreach($rowadd as $rowaddress) {?>
				<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: #fdsdfdf 0px solid">
					<tr bgcolor="#f4f4f4" height="50">
						<td width="30" align="center">
							<input type="radio" name="addressid" id="select1" value="<?php echo $rowaddress["id"];?>" <?php if($i==1){?>checked<?php }?>>
						</td>
						<td width="" align="left" valign="middle">
							<?php echo $rowaddress["title"];?> &nbsp;&nbsp;
							<?php echo $rowaddress["nickname"];?> &nbsp;&nbsp;
							<?php echo $rowaddress["sex"];?> &nbsp;&nbsp;
							<?php echo $rowaddress["tel"];?>
						</td>
					</tr>
					<tr>
						<!-- <td height="1" colspan="3"></td> -->
					</tr>
				</table>
				<?php $i = $i+1;} ?>
            </div>
			<div class="login_cell">
				<select name="shfs">
					<option  value="配送">配送</option>
                    <option  value="自提">自提</option>
                </select>
            </div>
			<div class="login_cell">
                <select name="zffs">
                    <option  value="支付宝">支付宝</option>
                    <option  value="微信">微信</option>
                </select>
            </div>
			<div class="login_cell">
                <textarea  placeholder="留言" name="content"></textarea>
            </div>
            <input type="submit" class="btn" value="提交">
        </form>
    </div>
</div>
<?php
	include_once("footer.php");
?>
</body>
</html>